home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / StringCompare.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  10.8 KB  |  399 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        StringCompare.a
  3. ;
  4. ;    Contains:    Public interfaces for String Comparison and related operations
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__STRINGCOMPARE__') = 'UNDEFINED' THEN
  19. __STRINGCOMPARE__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  25.     include 'TextCommon.a'
  26.     ENDIF
  27.     IF &TYPE('__SCRIPT__') = 'UNDEFINED' THEN
  28.     include 'Script.a'
  29.     ENDIF
  30.  
  31. ;
  32. ;    Here are the current System 7 routine names and the translations to the older forms.
  33. ;    Please use the newer forms in all new code and migrate the older names out of existing
  34. ;    code as maintenance permits.
  35. ;    
  36. ;    NEW NAME                    OLD NAME                    OBSOLETE FORM (no handle)
  37. ;    
  38. ;    CompareString (Str255)        IUCompPString (hp only)        IUCompString (hp only)
  39. ;    CompareText (ptr/len)        IUMagPString                IUMagString
  40. ;    IdenticalString (Str255)    IUEqualPString (hp only)    IUEqualString  (hp only)
  41. ;    IdenticalText (ptr/len)        IUMagIDPString                IUMagIDString
  42. ;    LanguageOrder                IULangOrder
  43. ;    ScriptOrder                    IUScriptOrder
  44. ;    StringOrder (Str255)        IUStringOrder (hp only)
  45. ;    TextOrder (ptr/len)            IUTextOrder
  46. ;
  47. ;    RelString
  48. ;    CmpString (a only)                    
  49. ;    EqualString (hp only)
  50. ;    
  51. ;    ReplaceText
  52. ;
  53. ;
  54.  
  55.  
  56.  
  57.                                                             ; Special language code values for Language Order
  58. systemCurLang                    EQU        -2                    ; current (itlbLang) lang for system script
  59. systemDefLang                    EQU        -3                    ; default (table) lang for system script
  60. currentCurLang                    EQU        -4                    ; current (itlbLang) lang for current script
  61. currentDefLang                    EQU        -5                    ; default lang for current script
  62. scriptCurLang                    EQU        -6                    ; current (itlbLang) lang for specified script
  63. scriptDefLang                    EQU        -7                    ; default language for a specified script
  64. ;  obsolete names
  65.  
  66. iuSystemCurLang                    EQU        -2
  67. iuSystemDefLang                    EQU        -3
  68. iuCurrentCurLang                EQU        -4
  69. iuCurrentDefLang                EQU        -5
  70. iuScriptCurLang                    EQU        -6
  71. iuScriptDefLang                    EQU        -7
  72.  
  73.  
  74. ;   The following functions are old names, but are required for System 7 PowerPC builds
  75. ;   because InterfaceLib exports these names, instead of the new ones.
  76.  
  77.  
  78.  
  79. ;
  80. ; pascal short IUMagPString(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
  81. ;
  82.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  83.         Macro
  84.         _IUMagPString
  85.             move.w              #$001A,-(sp)
  86.             dc.w                $A9ED
  87.         EndM
  88.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  89.         IMPORT_CFM_FUNCTION IUMagPString
  90.     ENDIF
  91.  
  92. ;
  93. ; pascal short IUMagIDPString(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
  94. ;
  95.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  96.         Macro
  97.         _IUMagIDPString
  98.             move.w              #$001C,-(sp)
  99.             dc.w                $A9ED
  100.         EndM
  101.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  102.         IMPORT_CFM_FUNCTION IUMagIDPString
  103.     ENDIF
  104.  
  105. ;
  106. ; pascal short IUTextOrder(const void *aPtr, const void *bPtr, short aLen, short bLen, ScriptCode aScript, ScriptCode bScript, LangCode aLang, LangCode bLang)
  107. ;
  108.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  109.         Macro
  110.         _IUTextOrder
  111.             move.w              #$0022,-(sp)
  112.             dc.w                $A9ED
  113.         EndM
  114.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  115.         IMPORT_CFM_FUNCTION IUTextOrder
  116.     ENDIF
  117.  
  118. ;
  119. ; pascal short IULangOrder(LangCode language1, LangCode language2)
  120. ;
  121.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  122.         Macro
  123.         _IULangOrder
  124.             move.w              #$0020,-(sp)
  125.             dc.w                $A9ED
  126.         EndM
  127.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  128.         IMPORT_CFM_FUNCTION IULangOrder
  129.     ENDIF
  130.  
  131. ;
  132. ; pascal short IUScriptOrder(ScriptCode script1, ScriptCode script2)
  133. ;
  134.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  135.         Macro
  136.         _IUScriptOrder
  137.             move.w              #$001E,-(sp)
  138.             dc.w                $A9ED
  139.         EndM
  140.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  141.         IMPORT_CFM_FUNCTION IUScriptOrder
  142.     ENDIF
  143.  
  144. ;  The following are new names which are not exported by System 7 InterfaceLib for PowerPC.
  145. ;
  146. ; pascal short CompareText(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
  147. ;
  148.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  149.         Macro
  150.         _CompareText
  151.             move.w              #$001A,-(sp)
  152.             dc.w                $A9ED
  153.         EndM
  154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION CompareText
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal short IdenticalText(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  162.         Macro
  163.         _IdenticalText
  164.             move.w              #$001C,-(sp)
  165.             dc.w                $A9ED
  166.         EndM
  167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION IdenticalText
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal short TextOrder(const void *aPtr, const void *bPtr, short aLen, short bLen, ScriptCode aScript, ScriptCode bScript, LangCode aLang, LangCode bLang)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  175.         Macro
  176.         _TextOrder
  177.             move.w              #$0022,-(sp)
  178.             dc.w                $A9ED
  179.         EndM
  180.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  181.         IMPORT_CFM_FUNCTION TextOrder
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal short LanguageOrder(LangCode language1, LangCode language2)
  186. ;
  187.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  188.         Macro
  189.         _LanguageOrder
  190.             move.w              #$0020,-(sp)
  191.             dc.w                $A9ED
  192.         EndM
  193.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION LanguageOrder
  195.     ENDIF
  196.  
  197.  
  198. ;   The following new function name IS exported by InterfaceLib and works on both 68k and
  199. ;   System 7 PowerPC.
  200.  
  201.  
  202. ;
  203. ; pascal short ScriptOrder(ScriptCode script1, ScriptCode script2)
  204. ;
  205.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  206.         Macro
  207.         _ScriptOrder
  208.             move.w              #$001E,-(sp)
  209.             dc.w                $A9ED
  210.         EndM
  211.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  212.         IMPORT_CFM_FUNCTION ScriptOrder
  213.     ENDIF
  214.  
  215.  
  216. ;   The following new function name IS exported by InterfaceLib and works on both 68k and
  217. ;   System 7 PowerPC.
  218.  
  219.  
  220. ;
  221. ; pascal short ReplaceText(Handle baseText, Handle substitutionText, Str15 key)
  222. ;
  223.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  224.         Macro
  225.         _ReplaceText
  226.             move.l              #$820CFFDC,-(sp)
  227.             dc.w                $A8B5
  228.         EndM
  229.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  230.         IMPORT_CFM_FUNCTION ReplaceText
  231.     ENDIF
  232.  
  233. ;
  234. ; pascal short IUMagString(const void *aPtr, const void *bPtr, short aLen, short bLen)
  235. ;
  236.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  237.         Macro
  238.         _IUMagString
  239.             move.w              #$000A,-(sp)
  240.             dc.w                $A9ED
  241.         EndM
  242.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION IUMagString
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal short IUMagIDString(const void *aPtr, const void *bPtr, short aLen, short bLen)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  250.         Macro
  251.         _IUMagIDString
  252.             move.w              #$000C,-(sp)
  253.             dc.w                $A9ED
  254.         EndM
  255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION IUMagIDString
  257.     ENDIF
  258.  
  259.     IF TARGET_CPU_68K THEN
  260. ;
  261. ; extern SInt32 RelString(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  264.         ; parameters:
  265.         ;    textPtrA        => A0
  266.         ;    textPtrB        => A1
  267.         ;    lengthAB        => D0
  268.         ; returns:
  269.         ;    SInt32          <= D0
  270.         _RelString:    OPWORD    $A050
  271.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION RelString
  273.     ENDIF
  274.  
  275. ;
  276. ; extern SInt32 RelStringMarks(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  279.         ; parameters:
  280.         ;    textPtrA        => A0
  281.         ;    textPtrB        => A1
  282.         ;    lengthAB        => D0
  283.         ; returns:
  284.         ;    SInt32          <= D0
  285.         _RelStringMarks:    OPWORD    $A250
  286.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  287.         IMPORT_CFM_FUNCTION RelStringMarks
  288.     ENDIF
  289.  
  290. ;
  291. ; extern SInt32 RelStringCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  292. ;
  293.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  294.         ; parameters:
  295.         ;    textPtrA        => A0
  296.         ;    textPtrB        => A1
  297.         ;    lengthAB        => D0
  298.         ; returns:
  299.         ;    SInt32          <= D0
  300.         _RelStringCase:    OPWORD    $A450
  301.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION RelStringCase
  303.     ENDIF
  304.  
  305. ;
  306. ; extern SInt32 RelStringMarksCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  309.         ; parameters:
  310.         ;    textPtrA        => A0
  311.         ;    textPtrB        => A1
  312.         ;    lengthAB        => D0
  313.         ; returns:
  314.         ;    SInt32          <= D0
  315.         _RelStringMarksCase:    OPWORD    $A650
  316.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION RelStringMarksCase
  318.     ENDIF
  319.  
  320. ;
  321. ; extern UInt32 CmpString(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  322. ;
  323.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  324.         ; parameters:
  325.         ;    textPtrA        => A0
  326.         ;    textPtrB        => A1
  327.         ;    lengthAB        => D0
  328.         ; returns:
  329.         ;    UInt32          <= D0
  330.         _CmpString:    OPWORD    $A03C
  331.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  332.         IMPORT_CFM_FUNCTION CmpString
  333.     ENDIF
  334.  
  335. ;
  336. ; extern UInt32 CmpStringMarks(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  337. ;
  338.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  339.         ; parameters:
  340.         ;    textPtrA        => A0
  341.         ;    textPtrB        => A1
  342.         ;    lengthAB        => D0
  343.         ; returns:
  344.         ;    UInt32          <= D0
  345.         _CmpStringMarks:    OPWORD    $A23C
  346.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  347.         IMPORT_CFM_FUNCTION CmpStringMarks
  348.     ENDIF
  349.  
  350. ;
  351. ; extern UInt32 CmpStringCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  352. ;
  353.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  354.         ; parameters:
  355.         ;    textPtrA        => A0
  356.         ;    textPtrB        => A1
  357.         ;    lengthAB        => D0
  358.         ; returns:
  359.         ;    UInt32          <= D0
  360.         _CmpStringCase:    OPWORD    $A43C
  361.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  362.         IMPORT_CFM_FUNCTION CmpStringCase
  363.     ENDIF
  364.  
  365. ;
  366. ; extern UInt32 CmpStringMarksCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
  367. ;
  368.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  369.         ; parameters:
  370.         ;    textPtrA        => A0
  371.         ;    textPtrB        => A1
  372.         ;    lengthAB        => D0
  373.         ; returns:
  374.         ;    UInt32          <= D0
  375.         _CmpStringMarksCase:    OPWORD    $A63C
  376.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  377.         IMPORT_CFM_FUNCTION CmpStringMarksCase
  378.     ENDIF
  379.  
  380.     ELSE
  381. ;
  382. ; pascal short RelString(ConstStr255Param str1, ConstStr255Param str2, Boolean caseSensitive, Boolean diacSensitive)
  383. ;
  384.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  385.         IMPORT_CFM_FUNCTION RelString
  386.     ENDIF
  387.  
  388. ;
  389. ; pascal Boolean EqualString(ConstStr255Param str1, ConstStr255Param str2, Boolean caseSensitive, Boolean diacSensitive)
  390. ;
  391.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  392.         IMPORT_CFM_FUNCTION EqualString
  393.     ENDIF
  394.  
  395.     ENDIF    ; TARGET_CPU_68K
  396.     ENDIF ; __STRINGCOMPARE__ 
  397.  
  398.